<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户注册页</title>
    <link rel="stylesheet" href="./css/login.css" type="text/css"/>
    <style>
        html, body{
            height: 100%;
        }

        body{
            font: 12px 'Lucida Sans Unicode', 'Trebuchet MS', Arial, Helvetica;
            margin: 0;
            background: url('./img/testbg.jpg') no-repeat;
            background-size: cover;
            -webkit-background-size: cover;
            -o-background-size: cover;
            background-position: center 0;
        }
        #login{
            background-color: #fff;
            background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#eee));
            background-image: -webkit-linear-gradient(top, #fff, #eee);
            background-image: -moz-linear-gradient(top, #fff, #eee);
            background-image: -ms-linear-gradient(top, #fff, #eee);
            background-image: -o-linear-gradient(top, #fff, #eee);
            background-image: linear-gradient(top, #fff, #eee);
            height: 240px;
            width: 400px;
            margin: -150px 0 0 -230px;
            padding: 30px;
            position: absolute;
            top: 50%;
            left: 50%;
            z-index: 0;
            -moz-border-radius: 3px;
            -webkit-border-radius: 3px;
            border-radius: 3px;
            -webkit-box-shadow:
                    0 0 2px rgba(0, 0, 0, 0.2),
                    0 1px 1px rgba(0, 0, 0, .2),
                    0 3px 0 #fff,
                    0 4px 0 rgba(0, 0, 0, .2),
                    0 6px 0 #fff,
                    0 7px 0 rgba(0, 0, 0, .2);
            -moz-box-shadow:
                    0 0 2px rgba(0, 0, 0, 0.2),
                    1px 1px   0 rgba(0,   0,   0,   .1),
                    3px 3px   0 rgba(255, 255, 255, 1),
                    4px 4px   0 rgba(0,   0,   0,   .1),
                    6px 6px   0 rgba(255, 255, 255, 1),
                    7px 7px   0 rgba(0,   0,   0,   .1);
            box-shadow:
                    0 0 2px rgba(0, 0, 0, 0.2),
                    0 1px 1px rgba(0, 0, 0, .2),
                    0 3px 0 #fff,
                    0 4px 0 rgba(0, 0, 0, .2),
                    0 6px 0 #fff,
                    0 7px 0 rgba(0, 0, 0, .2);
        }

        #login:before{
            content: '';
            position: absolute;
            z-index: -1;
            border: 1px dashed #ccc;
            top: 5px;
            bottom: 5px;
            left: 5px;
            right: 5px;
            -moz-box-shadow: 0 0 0 1px #fff;
            -webkit-box-shadow: 0 0 0 1px #fff;
            box-shadow: 0 0 0 1px #fff;
        }
    </style>
</head>
<body id="boby" >
<table id="login" >
    <th>
        <h1>注册</h1>
        <fieldset id="inputs">
            <input id="username" type="text" placeholder="用户名" autofocus required><br />
            <input id="password" type="password" placeholder="密码" required>
        </fieldset>
        <fieldset id="actions">
            <input type="submit" id="submit" value="注册">
            <a href="login.html">返回登陆界面</a>
        </fieldset>
    </th>
</table>
<script src="js/jquery.js"></script>
<script type="text/javascript">
    $(function () {
        $("#submit").click(function () {
            //触发按钮提交ajax
            var name=$("#username").val();
            var pass=$("#password").val();
            $.ajax({
                url: "./users.json",
                type: "POST",
                datatype:"JSON",
                data: {username:$("#username").val(),password:$("#password").val()},
                success: function (res) {
                    var list = res.animals

                },
                error: function () {
                    alert("提交失败！");
                }
            });







            //获取输入框账号密码
            /* alert(name+" "+pass)*/
/*            $.ajax({
                url:"/pxthadoop/regist",
                data:{"name":$("#username").val(),"pass":$("#password").val()},
                type:"post",
                dataType:"json",
                Async:false,
                success:function (data) {
                    /!*!//返回了json格式
                        str =JSON.stringify(data)
                         alert(str);*!/
                    if(data.code==200){
                        //跳转页面
                        alert("注册成功");
                    }else {
                        alert("注册格式错误");
                    }
                }
            })*/
        });
    });
</script>
</body>
</html>